﻿<!DOCTYPE html>
<html>
<head>
    <script src="/js/header.js"></script>
</head>
<body>
    <div class="data-wrap case" id="container">
        <div class="data-tool clearfix">
            <div class="pull-left form-inline ">
            </div>
            <div class="pull-right">
                <form class="form-inline" id="formSearch">
                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">公司名称：</label>
                        <input class="form-control" name="companyName" type="text" autocomplete="off" />
                    </div>

                    <div class="input-group input-group-sm" style="display:none">
                        <label class="input-group-addon m5_l">订单号：</label>
                        <input class="form-control" name="orderNo" type="text" autocomplete="off" />
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">银行名称：</label>
                        <input class="form-control" name="bankName" type="text" autocomplete="off" />
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">银行卡号：</label>
                        <input class="form-control" name="cardNumber" type="text" autocomplete="off" />
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">用戶名：</label>
                        <input class="form-control" name="cardName" type="text" />
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">类型：</label>
                        <select class="form-control" id="cardType" name="cardType">
                            <option value="">请选择</option>
                            <option value="1">收款卡</option>
                            <option value="2">中转卡</option>
                            <option value="3">付款卡</option>
                            <option value="4">备用卡</option>
                        </select>
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">启用状态：</label>
                        <select class="form-control" name="enableStatus">
                            <option value="">请选择</option>
                            <option value="1">启用</option>
                            <option value="2">禁用</option>
                        </select>
                    </div>

                    <div class="input-group input-group-sm">
                        <label class="input-group-addon m5_l">授权状态：</label>
                        <select class="form-control" name="authStatus">
                            <option value="">请选择</option>
                            <option value="1">已分配公司</option>
                            <option value="0">未分配公司</option>
                        </select>
                    </div>

                    <button type="button" class="btn btn-default btn-sm active" id="btnSearch"><span class="glyphicon glyphicon-search"></span> 搜索</button>
                </form>
            </div>
        </div>

        <div class="paging">
        </div>

    </div>

    <script type="text/x-dot-template" id="otherCardTemplate">
        <div class="data-body data-scroll">
            <div class="data-view">
                <div class="data-div-view table-responsive">
                    <table class="table table-hover table-striped table-bordered">
                        <thead>
                            <tr>
                                <th class="t_l wd100">公司名称</th>
                                <th class="t_l wd100">公司英文名称</th>

                                <th class="t_l wd100">银行名称</th>
                                <th class="t_l wd100">用户名</th>

                                <th class="t_l wd125">银行卡号</th>
                                <th class="t_l wd125">副卡号</th>
                                <th class="t_c wd125">类型</th>
                                <th class="t_c wd125">使用状态</th>
                                <th class="t_c wd125">启用状态</th>
                                <th class="wd125">建立人员</th>
                                <th class="wd130">建立时间</th>
                                <th class="wd125">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{? it.tData && it.tData.length>0}}
                            {{~it.tData :item:index}}
                            <tr>
                                <td class="t_l wd100">{{? item.companyName==null }}<span>未分配</span>{{?? }}{{= item.companyName }}{{? }}</td>
                                <td class="t_l wd100">{{? item.companyNameEN==null }}<span>未分配</span>{{?? }}{{= item.companyNameEN }}{{? }}</td>

                                <td class="t_l wd100">{{= item.bankName }}</td>
                                <td class="t_l wd100"><b>{{= item.cardName }}</b></td>

                                <td class="t_l wd125">{{= FlashPay.Util.SubCardNumber(item.cardNumber) }}</td>
                                <td class="t_l wd125">{{= FlashPay.Util.SubCardNumber(item.secCardNumber) }}</td>

                                <td class="t_c wd100">{{= FlashPay.Util.GetCardTypeValue(item.cardType) }}</td>
                                <td class="t_c wd100">{{= FlashPay.Util.GetCardStatusValue(item.usingStatus) }}</td>
                                <td class="t_c wd100">{{= FlashPay.Util.GetCardEnableStatusValue(item.enableStatus) }}</td>
                                <td class="wd125">{{= item.createName }}</td>
                                <td class="wd130">{{= item.createDate }}</td>
                                <td class="wd125">
                                    {{? item.enableStatus==1 }}
                                    <a class="btn btn-warning btn-xs" data-confirm=' "{{= item.cardName }}" <br>确定要<span class="orange">禁用</span>该银行卡？' data-href="/Bank/B2BUpdateStatus?id={{= item.bcId}}&status=2">禁用</a>

                                    <button type="button" class="btn btn-default btn-xs" data-href="/view/bankcard/obsoletecardedit.html?id={{= item.bcId}}" data-title="查看 -" data-width="460" data-height="650" onclick="return dialogOpen(this);"><span class="glyphicon glyphicon-edit"></span> 查看</button>
                                    {{?? }}
                                    <a class="btn btn-success btn-xs" data-confirm=' "{{= item.cardName }}" <br>确定要<span class="orange">启用</span>该银行卡？' data-href="/Bank/B2BUpdateStatus?id={{= item.bcId}}&status=1">启用</a>
                                    {{? }}
                                    {{? item.enableStatus==2 }}
                                    <button type="button" class="btn btn-default btn-xs" data-href="/view/bankcard/editb2b.html?id={{= item.bcId}}" data-title="编辑 - {{= item.cardName }}" data-width="452" data-height="550" onclick="return dialogOpen(this);">
                                        <span class="glyphicon glyphicon-edit"></span> 编辑
                                    </button>

                                    {{?}}
                                </td>
                            </tr>
                            {{~}}
                            {{??}}
                            <tr class="noRecord">
                                <td colspan="12">暂无记录！</td>
                            </tr>
                            {{?}}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- 必要的分页参数设置 -->
        <input type="hidden" id="TotalCount" value="{{=it.totalCount}}" />
    </script>

    <script type="text/x-dot-template" id="paymentCardTemplate">
        <div class="data-body data-scroll">
            <div class="data-view">
                <div class="data-div-view table-responsive">
                    <table class="table table-hover table-striped table-bordered">
                        <thead>
                            <tr>
                                <th class="t_l wd100">公司名称</th>
                                <th class="t_l wd100">公司英文名称</th>

                                <th class="t_l wd125">银行名称</th>
                                <th class="t_l wd100">银行卡用户名</th>

                                <th class="t_l wd125">银行卡号</th>
                                <th class="t_l wd125">银行卡副卡号</th>

                                <th class="t_c wd100">银行卡类型</th>
                                <th class="t_c wd100">银行卡使用状态</th>
                                <th class="t_c wd100">银行卡启用状态</th>

                                <th class="t_r wd125">付款区间起迄</th>
                                <th class="t_r wd100">付款费率(%)</th>
                                <th class="t_c wd100">跨行转账</th>
                                <th class="t_l wd100">存款等级</th>
                                <th class="wd125">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{? it.tData && it.tData.length>0}}
                            {{~it.tData :item:index}}
                            <tr>
                                <td class="t_l wd100">{{? item.companyName==null }}<span>未分配</span>{{?? }}{{= item.companyName }}{{? }}</td>
                                <td class="t_l wd100">{{? item.companyNameEN==null }}<span>未分配</span>{{?? }}{{= item.companyNameEN }}{{? }}</td>

                                <td class="t_l wd100">{{= item.bankName }}</td>
                                <td class="t_l wd100"><b>{{= item.cardName }}</b></td>

                                <td class="t_l wd125">{{= FlashPay.Util.SubCardNumber(item.cardNumber) }}</td>
                                <td class="t_l wd125">{{= FlashPay.Util.SubCardNumber(item.secCardNumber) }}</td>

                                <td class="t_c wd100">{{= FlashPay.Util.GetCardTypeValue(item.cardType) }}</td>
                                <td class="t_c wd100">{{= FlashPay.Util.GetCardStatusValue(item.usingStatus) }}</td>
                                <td class="t_c wd100">{{= FlashPay.Util.GetCardEnableStatusValue(item.enableStatus) }}</td>

                                <td class="t_r wd125">{{= item.paymentInterval }}</td>
                                <td class="t_r wd100">{{= item.payFeeRatio }}(%)</td>
                                <td class="t_c wd100">{{= FlashPay.Util.GetCrossBankPayValue(item.crossBankPay) }}</td>
                                <td class="t_l wd100">{{= item.depositType }}</td>

                                <td class="wd125">
                                    {{? item.enableStatus==1 }}
                                    <a class="btn btn-warning btn-xs" data-confirm=' "{{= item.cardName }}" <br>确定要<span class="orange">禁用</span>该银行卡？' data-href="/Bank/B2BUpdateStatus?id={{= item.bcId}}&status=2">禁用</a>
                                    {{?? }}
                                    <a class="btn btn-success btn-xs" data-confirm=' "{{= item.cardName }}" <br>确定要<span class="orange">启用</span>该银行卡？' data-href="/Bank/B2BUpdateStatus?id={{= item.bcId}}&status=1">启用</a>
                                    {{? }}
                                    {{? item.enableStatus==2 }}
                                    <button type="button" class="btn btn-default btn-xs" data-href="/view/bankcard/editb2b.html?id={{= item.bcId}}" data-title="编辑 - {{= item.cardName }}" data-width="452" data-height="550" onclick="return dialogOpen(this);"><span class="glyphicon glyphicon-edit"></span> 编辑</button>
                                    {{?}}
                                </td>
                            </tr>
                            {{~}}
                            {{??}}
                            <tr class="noRecord">
                                <td colspan="14">暂无记录！</td>
                            </tr>
                            {{?}}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <!-- 必要的分页参数设置 -->
        <input type="hidden" id="TotalCount" value="{{=it.totalCount}}" />
    </script>
    <script src="/js/page/indexb2b.js?v=201902060911"></script>
    <script type="text/javascript">
        function Tip_success(word) {
            FlashPay.UI.Tip_success(word);
        }

        $(function () {

            FlashPay.UI.DataAutoHeight();

            FlashPay.UI.DoSearch();

            $("#btnSearch").click(function () {
                window.currentPage = null;
                doSearch();
            });
        });

        $(document).keyup(function (event) {
            var keycode = event.which;
            if (keycode == 13) {
                FlashPay.UI.DoSearch();
            }
        });

        function dialogOpen(obj) {
            FlashPay.UI.DialogOpen($(obj).data('href'), {
                title: $(obj).data('title'),
                width: 452,
                height: 550,
            });
        }

        function doSearch() {

            var cardType = $("#cardType option:selected").val()

            if (cardType == 3) {
                FlashPay.UI.Pager(".paging", { templateId: "paymentCardTemplate", pageSize: 15, ajax: { url: '/Bank/GetB2BPager' } });
            }
            else {
                FlashPay.UI.Pager(".paging", { templateId: "otherCardTemplate", pageSize: 15, ajax: { url: '/Bank/GetB2BPager' } });
            }
        }
    </script>
</body>
</html >
